export const eventData = [
    {
        id: '126991329',
        desc: '可以连接wifi，但无法完成认证过程',
        type: '无法认证',
        source: '用户',
        source_id: '8138130123',
        priority: 2,
        created_time: '2018-03-15 15:08:48',
        updated_time: '2018-03-15 15:08:48',
        client_id: '00:1A:1E:02:F5:70',
        username: '8138130123',
        ap_id: '00:1A:1E:02:F5:70',
        ap_name: '00:1A:1E:02:F5:70',
        controller_id: '00:1A:1E:02:F5:70',
        controller_name: 'SLR01-WiFi-08a',
        status: '待解决',
        owner: '测试人员'
    },
    {
        id: '126991329',
        desc: '可以连接wifi，但无法完成认证过程',
        type: '无法认证',
        source: '用户',
        source_id: '8138130123',
        priority: 0,
        created_time: '2018-03-15 15:08:48',
        updated_time: '2018-03-15 15:08:48',
        client_id: '00:1A:1E:02:F5:70',
        username: '8138130123',
        ap_id: '00:1A:1E:02:F5:70',
        ap_name: '00:1A:1E:02:F5:70',
        controller_id: '00:1A:1E:02:F5:70',
        controller_name: 'SLR01-WiFi-08a',
        status: '待解决',
        owner: '测试人员'
    },
    {
        id: '126991329',
        desc: '可以连接wifi，但无法完成认证过程',
        type: '无法认证',
        source: '用户',
        source_id: '8138130123',
        priority: 2,
        created_time: '2018-03-15 15:08:48',
        updated_time: '2018-03-15 15:08:48',
        client_id: '00:1A:1E:02:F5:70',
        username: '8138130123',
        ap_id: '00:1A:1E:02:F5:70',
        ap_name: '00:1A:1E:02:F5:70',
        controller_id: '00:1A:1E:02:F5:70',
        controller_name: 'SLR01-WiFi-08a',
        status: '待解决',
        owner: '测试人员'
    },
    {
        id: '126991329',
        desc: '可以连接wifi，但无法完成认证过程',
        type: '无法认证',
        source: '用户',
        source_id: '8138130123',
        priority: 2,
        created_time: '2018-03-15 15:08:48',
        updated_time: '2018-03-15 15:08:48',
        client_id: '00:1A:1E:02:F5:70',
        username: '8138130123',
        ap_id: '00:1A:1E:02:F5:70',
        ap_name: '00:1A:1E:02:F5:70',
        controller_id: '00:1A:1E:02:F5:70',
        controller_name: 'SLR01-WiFi-08a',
        status: '待解决',
        owner: '测试人员'
    }
];

export const eventColumns = [
    {
        'title': '编号',
        'key': 'id',
        'fixed': 'left',
        width: 120,
    },
    {
        'title': '来源',
        'key': 'source',
        width: 120,
        filters: [
            {
                label: '用户',
                value: '用户'
            },
            {
                label: '设备',
                value: '设备'
            },
            {
                label: '管理人员',
                value: '管理人员'
            }
        ],
        filterMultiple: false,
        filterMethod(value, row) {
            return row.status === value
        },
    },
    {
        'title': '类型',
        'key': 'type',
        width: 160,
    },
    {
        'title': '状态',
        'key': 'show',
        'width': 120,
        filters: [
            {
                label: '待解决',
                value: '待解决'
            }
        ],
        filterMultiple: false,
        filterMethod(value, row) {
            return row.status === value
        },
        render: (h, params) => {
            return h('Tag', {
                props:
                    { color: 'orange' }
            }, params.row.status);
        }
    },
    {
        'title': '优先级',
        'key': 'priority',
        'width': 100,
        render: (h, params) => {
            return h('span', {
                style: { color: ['green', 'orange', 'red'][params.row.priority] }
            }, ['低', '中', '高'][params.row.priority]);
        },
        'sortable': true
    },
    {
        'title': '创建时间',
        'key': 'created_time',
        'width': 160,
        'sortable': true
    },
    {
        'title': '更新时间',
        'key': 'updated_time',
        'width': 160,
        'sortable': true
    },
    {
        'title': 'Root Cause',
        'key': 'cause',
        width: 240,
    },
    {
        'title': '负责人',
        'key': 'owner',
        'width': 120,
    },
    {
        'title': '描述',
        'key': 'desc',
        'width': 160,
    },
    {
        'title': '相关用户名',
        'key': 'username',
        'width': 160,
    },
    {
        'title': 'ap名',
        'key': 'ap_name',
        'width': 160,
    },
    {
        'title': '控制器名',
        'key': 'controller_name',
        'width': 160,
    },
    {
        title: '操作',
        key: 'action',
        fixed: 'right',
        width: 70,
        render: (h, params) => {
            return h('div', [
                h('Button', {
                    style: {
                        marginRight: '12px'
                    },
                    props: {
                        type: 'primary',
                        size: 'small'
                    }
                }, [h('a', { domProps: { href: `#/event-check/${params.row.id}` }, style: {color: 'white'} }, '处理')]),
                // h('Button', {
                //     props: {
                //         type: 'primary',
                //         size: 'small'
                //     }
                // }, [h('a', { domProps: { href: `#/event-finish/${params.row.id}` }, style: {color: 'white'} }, '处理')])
            ]);
        }
    }
];
